﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage<Entity.PagedList<Entity.TEST.Category>>" %>

<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
    Index
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
    <h2>
        Index</h2>
    <script src="../../Scripts/JQTree/jquery.tree.js" type="text/javascript"></script>
    <link href="../../Scripts/JQTree/themes/checkbox/style.css" rel="stylesheet" type="text/css" />
    <script src="../../Scripts/JQTree/plugins/jquery.tree.checkbox.js" type="text/javascript"></script>
    <script src="../../Scripts/Category.js" type="text/javascript"></script>
    <%=Html.DropDownList("CategoryID",new SelectList(Model,"ID","Name")) %>
    <table class="liebiao_table" cellspacing="1" cellpadding="3" width="100%">
        <thead>
            <tr>
                <th>
                </th>
                <th>
                    编号
                </th>
                <th>
                    名称
                </th>
                <th>
                    父ID
                </th>
            </tr>
        </thead>
        <tbody>
            <% foreach (var item in Model)
               { %>
            <tr>
                <td width="300">
                    <%=Html.ActionLink("Edit", "Edit", new { id=item.ID }) %>
                    <%=Html.ActionLinkForViewFillToDialog("详细","Detail","Category" ,"id",item.ID)%>
                    <%=Html.ActionLinkForConfirm("删除", "Delete", new { id=item.ID })%>
                    <%=Html.ActionLinkForViewFillToDialog("建立分类","UCCreate","Category")%>
                    <%=Html.ActionLinkForViewFillToDialog("编辑分类","UCEdit","Category",item.ID)%>
                </td>
                <td>
                    <%: item.ID %>
                </td>
                <td>
                    <%: item.Name %>
                </td>
                <td>
                    <%: item.ParentID %>
                </td>
            </tr>
            <% } %></tbody>
        <tfoot>
            <tr>
                <td colspan="4">
                    <%=Html.Pager(Model) %>
                </td>
            </tr>
        </tfoot>
    </table>
    <input type="button" id="Insert_Btn" value="插入" />
    <input type="button" id="Delete_Btn" value="删除" />
    <div id="PCategoryTree">
        <%= ViewData["CategoryData"]  %>
    </div>
    <p>
        <%: Html.ActionLink("Create New", "Create") %>
    </p>
</asp:Content>
